/**
 * 数据库操作统一入口
 */
package com.xiaomuwu.android.logic.dao

import com.xiaomuwu.android.logic.model.*

object XiaoMuWuDatabase {

//    private val connection
//        get() = DatabaseConnection.connectDatabase()
    private val connection= DatabaseConnection.connectDatabase()

    fun checkLogin(forCheckLogin: ForCheckLogin)=
        UserData.checkLogin(forCheckLogin, connection)

    fun registerUser(forOperateUser: ForOperateUser)=
        UserData.registerUser(forOperateUser, connection)

    fun modigyUser(forOperateUser: ForOperateUser)=
        UserData.modifyUser(forOperateUser, connection)

    fun getPersonal(userID: String?)=
        UserData.getPersonal(userID, connection)

    fun getRes(forRes: ForRes)=
        ResData.getRes(forRes, connection)

    fun getUser(forUser: ForUser)=
        UserData.getUser(forUser, connection)

    fun getReleRes(forReleRes: ForReleRes)=
        ResData.getReleRes(forReleRes, connection)

    fun getReleUser(forReleUser: ForReleUser)=
        UserData.getReleUser(forReleUser, connection)

    fun getResDetail(forResDetail: ForResDetail)=
        ResData.getResDetail(forResDetail, connection)

    fun getUserDetail(forUserDetail: ForUserDetail)=
        UserData.getUserDetail(forUserDetail, connection)

    fun likeRes(forLike: ForLike)=
        ResData.likeRes(forLike, connection)

    fun downloadRes(forDownLoad: ForDownLoad)=
        ResData.downloadRes(forDownLoad, connection)

    fun followUser(forFollow: ForFollow)=
        UserData.followUser(forFollow, connection)

    fun uploadRes(forUpload: ForUpload)=
        ResData.uploadRes(forUpload, connection)

    fun modigyRes(forModify: ForModify)=
        ResData.modifyRes(forModify, connection)

    fun deleteRes(resID:Long)=
        ResData.deleteRes(resID, connection)

}